﻿using UnityEngine;

[ExecuteInEditMode]
public class LookAt : MonoBehaviour
{
    public Transform target;
    public Vector3 angle;
    Vector3 targetPos;

    void Update()
    {
        if (!Application.isPlaying)
        {
            targetPos = target ? target.position : Vector3.zero;
            transform.LookAt(targetPos);
            transform.eulerAngles += angle;
        }
    }
}
